<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!-->
<html class="no-js">
<!--<![endif]-->
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>isuoge</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <!-- Favicon -->
    <link rel="shortcut icon" href="/Public/assets/img/favicon.ico" type="image/x-icon">
    <!-- Bootstrap core CSS -->
    <link rel="stylesheet" href="/Public/assets/plugins/bootstrap/css/bootstrap.min.css">
    <!-- Fonts from Font Awsome -->
    <link rel="stylesheet" href="/Public/assets/css/font-awesome.min.css">
    <!-- CSS Animate -->
    <link rel="stylesheet" href="/Public/assets/css/animate.css">
    <!-- Custom styles for this theme -->
    <link rel="stylesheet" href="/Public/assets/css/main.css">
    <!-- Vector Map  -->
    <link rel="stylesheet" href="/Public/assets/plugins/jvectormap/css/jquery-jvectormap-1.2.2.css">
    <!-- ToDos  -->
    <link rel="stylesheet" href="/Public/assets/plugins/todo/css/todos.css">
    <!-- Morris  -->
    <link rel="stylesheet" href="/Public/assets/plugins/morris/css/morris.css">
    <!--后台公共样式自写-->
    <link rel="stylesheet" href="/Public/css/admin/common.css">
    
    <link rel="stylesheet" href="/Public/layui/css/layui.css"/>
    <script src="/Public/js/jquery-1.11.0.js" type="text/javascript" charset="utf-8"></script>
    <script src="/Public/layui/layui.all.js" type="text/javascript" charset="utf-8"></script>
    <!--<script src="/Public/js/admin/upload_img.js" type="text/javascript" charset="utf-8"></script>-->
	<!--编辑器样式-->
    <!-- 单选按钮样式 -->
    <link rel="stylesheet" href="/Public/assets/plugins/icheck/css/_all.css">
	<script type="text/javascript" charset="utf-8" src="/Public/qiniu_ueditor_1.4.3-master/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Public/qiniu_ueditor_1.4.3-master/ueditor.all.min.js"> </script>
    <script type="text/javascript" charset="utf-8" src="/Public/qiniu_ueditor_1.4.3-master/lang/zh-cn/zh-cn.js"></script>
    <!-- Fonts -->
    <!-- <link href='http://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,900,300italic,400italic,600italic,700italic,900italic' rel='stylesheet' type='text/css'>
    <link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700' rel='stylesheet' type='text/css'> -->
    <!-- Feature detection -->
    <script src="/Public/assets/js/modernizr-2.6.2.min.js"></script>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="assets/js/html5shiv.js"></script>
    <script src="assets/js/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <section id="container">
        <header id="header">
            <!--logo 开始-->
            <div class="brand">
                <a href="#" class="logo">
                    <span>isuoge</span></a>
            </div>
            <!--logo 结束-->
            <div class="toggle-navigation toggle-left">
                <button type="button" class="btn btn-default" id="toggle-left" data-toggle="tooltip" data-placement="right" title="切换导航状态">
                    <i class="fa fa-bars"></i>
                </button>
            </div>
            <div class="user-nav">
                <ul>
                    <li class="dropdown messages">
                        <span class="badge badge-danager animated bounceIn" id="new-messages">2</span>
                        <button type="button" class="btn btn-default dropdown-toggle options" id="toggle-mail" data-toggle="dropdown">
                            <i class="fa fa-envelope"></i>
                        </button>
                        <ul class="dropdown-menu alert animated fadeInDown">
                            <li>
                                <h1>你有
                                    <strong>5</strong>条新消息</h1>
                            </li>
                            <li>
                                <a href="#">
                                    <div class="profile-photo">
                                        <img src="/Public/assets/img/avatar.gif" alt="" class="img-circle">
                                    </div>
                                    <div class="message-info">
                                        <span class="sender">James Bagian</span>
                                        <span class="time">30 mins</span>
                                        <div class="message-content">Lorem ipsum dolor sit amet, elit rutrum felis sed erat augue fusce...</div>
                                    </div>
                                </a>
                            </li>

                            <li>
                                <a href="#">
                                    <div class="profile-photo">
                                        <img src="/Public/assets/img/avatar1.gif" alt="" class="img-circle">
                                    </div>
                                    <div class="message-info">
                                        <span class="sender">Jeffrey Ashby</span>
                                        <span class="time">2 hour</span>
                                        <div class="message-content">hendrerit pellentesque, iure tincidunt, faucibus vitae dolor aliquam...</div>
                                    </div>
                                </a>
                            </li>

                            
                            <li><a href="#">全部设为已读 <i class="fa fa-angle-right"></i></a>
                            </li>
                        </ul>

                    </li>
                    <li class="profile-photo">
                        <img src="/Public/assets/img/avatar.png" alt="" class="img-circle">
                    </li>
                    <li class="dropdown settings">
                        <a class="dropdown-toggle" data-toggle="dropdown" href="#">
                     <?php echo$_SESSION['adminUser']['realname'];?> <i class="fa fa-angle-down"></i>
                    </a>
                        <ul class="dropdown-menu animated fadeInDown">
                            <li>
                                <a href="#"><i class="fa fa-user"></i> 个人中心</a>
                            </li>
                            <li>
                                <a href="#"><i class="fa fa-calendar"></i> 日历</a>
                            </li>
                            <li>
                                <a href="#"><i class="fa fa-envelope"></i> 消息盒子 <span class="badge badge-danager" id="user-inbox">5</span></a>
                            </li>
                            <li>
                                <a href="/admin.php?c=login&a=loginout"><i class="fa fa-power-off"></i> 退出登录</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <div class="toggle-navigation toggle-right">
                            <button type="button" class="btn btn-default" id="toggle-right">
                                <i class="fa fa-comment"></i>
                            </button>
                        </div>
                    </li>

                </ul>
            </div>
        </header>
    <!--sidebar left start-->
    	
<aside class="sidebar">
            <div id="leftside-navigation" class="nano">
			<?php
 $navs = D("Menu")->getAdminMenus(); $index = 'index'; $categorys = getTree($navs,0); ?>
                <ul class="nano-content">
                    <li class="<?php echo (getActive($index)); ?>">
                        <a href="admin.php"><i class="fa fa-dashboard"></i><span>后台管理</span></a>
                    </li>
            	<?php if(is_array($categorys)): $i = 0; $__LIST__ = $categorys;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$category): $mod = ($i % 2 );++$i;?><li class="sub-menu <?php echo (getActive($category["c"])); ?>">
            			<a href="<?php if($category["data"] == 'class'): ?>javascript:void(0);  <?php elseif($category["data"] != 'class'): echo (getAdminMenuUrl($category)); else: endif; ?>"><i class="fa fa-cogs"></i><span><?php echo ($category["name"]); ?></span><i class="arrow fa fa-angle-right pull-right"></i></a>
            			
            			<?php if($category["parentid"] != ''): ?><ul class="nano-content">
            					<?php if(is_array($category['parentid'])): $i = 0; $__LIST__ = $category['parentid'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$scategory): $mod = ($i % 2 );++$i;?><li class="sub-menu <?php echo (getActive($scategory["c"])); ?>">
	            					<a href="<?php echo (getAdminMenuUrl($scategory)); ?>"><i class="fa fa-cogs"></i><span><?php echo ($scategory["name"]); ?></span><i class="arrow fa fa-angle-right pull-right"></i></a>
            						</li><?php endforeach; endif; else: echo "" ;endif; ?>
            				</ul><?php endif; ?>
            		</li><?php endforeach; endif; else: echo "" ;endif; ?>

                    <!--<?php if(is_array($navs)): $i = 0; $__LIST__ = $navs;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$nav): $mod = ($i % 2 );++$i;?><li class="sub-menu <?php echo (getActive($nav["c"])); ?>">
	                        <a href="<?php echo (getAdminMenuUrl($nav)); ?>"><i class="fa fa-cogs"></i><span><?php echo ($nav["name"]); ?></span><i class="arrow fa fa-angle-right pull-right"></i></a>
	                    </li><?php endforeach; endif; else: echo "" ;endif; ?>-->
                    
                </ul>
            </div>

        </aside>
    <!--左侧栏 end-->
    <!--主内容 start-->
    <section class="main-content-wrapper">
        <section id="main-content">
            
            <div class="row">
                    <div class="col-md-12">
                        <div class="panel panel-default">
                            <div class="panel-heading">
                                <h3 class="panel-title">编辑推荐内容</h3>
                                <div class="actions pull-right">
                                    <i class="fa fa-chevron-down"></i>
                                    <i class="fa fa-times"></i>
                                </div>
                            </div>
                            <div class="panel-body"> 
                            	<div class="row">
									  <form class="form-horizontal form-border" id="cs_position_form">
									  		<input type="hidden" name="id" id="id" value="<?php echo ($positionCon["id"]); ?>" />
											<div class="form-group">
		                                    	<label class="col-sm-3 control-label">推荐位置</label>
		                                    	<div class="col-sm-6">
				                                    <select class="form-control" name="position_id">
				                                        <option value="">请选择---推荐位</option>
				                                        <?php if(is_array($positionnames)): foreach($positionnames as $key=>$positionname): ?><option value="<?php echo ($positionname["id"]); ?>" <?php if($positionCon['position_id'] == $positionname['id']): ?>selected="selected"<?php endif; ?> ><?php echo ($positionname["name"]); ?></option><?php endforeach; endif; ?>
				                                    </select>
			                                    </div>
		                                	</div>
		                                    <div class="form-group">
		                                        <label class="col-sm-3 control-label">标题</label>
		                                        <div class="col-sm-6">
		                                            <input type="text" value="<?php echo ($positionCon["title"]); ?>" name="title" class="form-control" placeholder="推荐位描述">
		                                        </div>
		                                    </div>
		                                    <div class="form-group">
		                                        <label class="col-sm-3 control-label">链接</label>
		                                        <div class="col-sm-6">
		                                            <input type="text" value="<?php echo ($positionCon["url"]); ?>" name="url" class="form-control" placeholder="推荐链接">
		                                        </div>
		                                    </div>
		                                    <div class="form-group">
		                                        <label class="col-sm-3 control-label">文章id</label>
		                                        <div class="col-sm-6">
		                                            <input type="text" name="news_id" value="<?php echo ($positionCon["news_id"]); ?>" class="form-control" placeholder="文章id">
		                                        </div>
		                                    </div>
		                                    
		                                    <div class="form-group">
		                                    	<label class="col-sm-3 control-label">缩略图</label>
		                                    	<div class="col-sm-6">
				                                    <input type="file" class="layui-upload-file" name="suosuo"  id="file_upload" /><br />
				                                    <div id="upload_img_show" style="display: none;  background-repeat: no-repeat; width: 200px; height: 200px;background-image: url(<?php echo ($positionCon["thumb"]); ?>); background-color: #D0D2D0;text-align: center;;margin-top: 10px;background-position: center;background-size: 100% auto;">
				                                   		 <p id="upload_tips" style="color: #ff0000;position: absolute; margin-top:80px; width: 200px; background-color: rgba(192,152,89,0.6);padding: 10px 0;">上传中</p>
				                                    </div>
				                                    <input type="hidden" name="thumb" id="file_upload_img" value="<?php echo ($positionCon["thumb"]); ?>" multiple="true" />
			                                    </div>
		                                	</div>
		                                    
		                                    <div class="form-group">
		                                        <label class="col-sm-3 control-label">推荐状态</label>
		                                        <div class="col-sm-6">
		                                            <div class="radio">
		                                                <input class="icheck" type="radio" <?php if($positionCon['status'] == 1): ?>checked<?php endif; ?> name="status" value="1">
		                                                <label>开启</label>
		                                            </div>
		                                            <div class="radio">
		                                                <input class="icheck" type="radio" <?php if($positionCon['status'] == 0): ?>checked<?php endif; ?> name="status" value="0">
		                                                <label>关闭</label>
		                                            </div>
		                                        </div>
		                                    </div>
		                                    
		                                     <div class="form-group">
		                                        <label class="col-sm-3 control-label"></label>
		                                        <div class="col-sm-6">
			                                        <button type="button" id="csbtn_content_sub" class="btn btn-primary">提交</button>
		                                        </div>
		                                    </div>
										</form>		
								</div><!-- /.row -->

                            	
								
                            </div>
                        </div>
                    </div>
                </div>
          
            
        </section>
    </section>
    <!--主内容区 end-->
    <script src="/Public/js/admin/position.js" type="text/javascript" charset="utf-8"></script>
    <script type="text/javascript">
    	var thumb ="<?php echo ($positionCon["thumb"]); ?>";
    	if (thumb) {
    		$("#upload_tips").hide();
    		$("#upload_img_show").show();
    	}
    
    	var SCOPE={
			'add_url':'/admin.php?c=PositionContent&a=add',
			'edit_url':'/admin.php?c=PositionContent&a=edit',
			'del_url':'/admin.php?c=PositionContent&a=del',
			'jump_url':'/admin.php?c=PositionContent&a=index',
			'listorder_url':'/admin.php?c=PositionContent&a=listorder',
			'ajax_upload_img_url':'/admin.php?c=image&a=save',
			
		}
    	
    	$(function  () {
			layui.upload({
				url:  SCOPE.ajax_upload_img_url,
				method : 'post',
				type : 'images',
				ext: 'jpg|png|gif|psd',
				title : '上传图片',
				before : function(input){
					$('#upload_img_show').show();
					console.log($(input).val());
					var $file = $(input);
					var fileObj = $file[0];
					var windowURL = window.URL || window.webkitURL;
					var dataURL;
					var $img = $("#upload_img_show");
					 
					if(fileObj && fileObj.files && fileObj.files[0]){
					dataURL = windowURL.createObjectURL(fileObj.files[0]);
					var bgurl = "url('"+dataURL+"')";
					$img.css({"background-image":bgurl});
					}
					
				},
				success: function(res, input){
					 var bgurl = "url('"+res.suosuo.url+"')";
					 console.log(bgurl);
					 $("#upload_tips").html("上传完成!");
					 $("#upload_tips").css({'color':'#fff'});
					 $('#file_upload_img').val(res.suosuo.url);
				}
			});
    	});
    	
    	
    </script>
        
   <!--右侧工具栏 start-->
        <aside class="sidebarRight">
            <div id="rightside-navigation ">
                <div class="sidebar-heading"><i class="fa fa-user"></i> Contacts</div>
                <div class="sidebar-title">online</div>
                <div class="list-contacts">
                    <a href="javascript:void(0)" class="list-item">
                        <div class="list-item-image">
                            <img src="/Public/assets/img/avatar.gif" class="img-circle">
                        </div>
                        <div class="list-item-content">
                            <h4>James Bagian</h4>
                            <p>Los Angeles, CA</p>
                        </div>
                        <div class="item-status item-status-online"></div>
                    </a>
                    <a href="javascript:void(0)" class="list-item">
                        <div class="list-item-image">
                            <img src="/Public/assets/img/avatar1.gif" class="img-circle">
                        </div>
                        <div class="list-item-content">
                            <h4>Jeffrey Ashby</h4>
                            <p>New York, NY</p>
                        </div>
                        <div class="item-status item-status-online"></div>
                    </a>
                    <a href="javascript:void(0)" class="list-item">
                        <div class="list-item-image">
                            <img src="/Public/assets/img/avatar2.gif" class="img-circle">
                        </div>
                        <div class="list-item-content">
                            <h4>John Douey</h4>
                            <p>Dallas, TX</p>
                        </div>
                        <div class="item-status item-status-online"></div>
                    </a>
                    <a href="javascript:void(0)" class="list-item">
                        <div class="list-item-image">
                            <img src="/Public/assets/img/avatar3.gif" class="img-circle">
                        </div>
                        <div class="list-item-content">
                            <h4>Ellen Baker</h4>
                            <p>London</p>
                        </div>
                        <div class="item-status item-status-away"></div>
                    </a>
                </div>

                <div class="sidebar-title">offline</div>
                <div class="list-contacts">
                    <a href="javascript:void(0)" class="list-item">
                        <div class="list-item-image">
                            <img src="/Public/assets/img/avatar4.gif" class="img-circle">
                        </div>
                        <div class="list-item-content">
                            <h4>Ivan Bella</h4>
                            <p>Tokyo, Japan</p>
                        </div>
                        <div class="item-status"></div>
                    </a>
                    <a href="javascript:void(0)" class="list-item">
                        <div class="list-item-image">
                            <img src="/Public/assets/img/avatar5.gif" class="img-circle">
                        </div>
                        <div class="list-item-content">
                            <h4>Gerald Carr</h4>
                            <p>Seattle, WA</p>
                        </div>
                        <div class="item-status"></div>
                    </a>
                    <a href="javascript:void(0)" class="list-item">
                        <div class="list-item-image">
                            <img src="/Public/assets/img/avatar6.gif" class="img-circle">
                        </div>
                        <div class="list-item-content">
                            <h4>Viktor Gorbatko</h4>
                            <p>Palo Alto, CA</p>
                        </div>
                        <div class="item-status"></div>
                    </a>
                </div>
            </div>
        </aside>
        <!--sidebar right end-->
    </section>
   
   <!--Global JS-->
    <script src="/Public/assets/js/jquery-1.10.2.min.js"></script>
    <script src="/Public/assets/plugins/bootstrap/js/bootstrap.min.js"></script>
    <script src="/Public/assets/plugins/waypoints/waypoints.min.js"></script>
    <script src="/Public/assets/js/application.js"></script>
    <!--Page Level JS-->
    <script src="/Public/assets/plugins/countTo/jquery.countTo.js"></script>
    <script src="/Public/assets/plugins/weather/js/skycons.js"></script>
    <!--Load these page level functions-->
    <script src="/Public/js/dialog.js"></script>
    <script src="/Public/assets/plugins/icheck/js/icheck.min.js"></script>
    
    
    <script>
    $(document).ready(function() {
        app.timer();
        $('input').iCheck({
	        checkboxClass: 'icheckbox_flat-grey',
	        radioClass: 'iradio_flat-grey'
        });
    });
    
    
    </script>   

</body>

</html>